<?php
namespace app\admin\controller\goods;

use think\Db;
class Car extends \app\admin\controller\Common
{
    public function index(){
    
        return view();
    }

    public function list(){
        $limit = request()->param('limit') ?? 15;
        $page = request()->param('page');
        $page = $page ? ($page - 1) * $limit : 0;
        $search = request()->param();
    
        $query = (new \app\common\model\GoodsCar());

        isset($search['title']) && $search['title'] != "" ? $query->where("title like '%{$search['title']}%'") : '';
        $query->order("order.id desc");
        $list = $query->limit($page, $limit)->select();
        $count = $query->count();
        return self::successResult('',$list,$count);
    }

    public function add(){
        $cate = (new \app\common\model\Classify())->list();

        $this->assign("cate",$cate);
        return view();
    }
  

  

 
}
